package mars.LWJGLDemo;
import org.lwjgl.LWJGLException;
import org.lwjgl.opengl.ContextAttribs;
import org.lwjgl.opengl.Display;
import org.lwjgl.opengl.DisplayMode;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.PixelFormat;

public class Main {

	public static void main(String[] args) {
		
		PixelFormat pixelFormat = new PixelFormat();
		ContextAttribs contextAttribs = new ContextAttribs(3, 1)
		.withForwardCompatible(true);
//		.withProfileCore(true);
		
		try {
			Display.setDisplayMode(new DisplayMode(320, 240));
			Display.setTitle("OpenGL Demo");
			Display.create(pixelFormat, contextAttribs);
			System.out.println("OpenGL version: " + GL11.glGetString(GL11.GL_VERSION));
		} catch (LWJGLException e) {
			e.printStackTrace();
		}
		
		while (!Display.isCloseRequested()) {
			Display.sync(60);
			Display.update();
		}
		
		Display.destroy();
	}

}
